Socket
Socket
Sign inDemoInstall

gulp-less

Package Overview
Dependencies
Maintainers
4
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-less

Less for Gulp


Version published
Weekly downloads
119K
increased by7.75%
Maintainers
4
Weekly downloads
 
Created

What is gulp-less?

The gulp-less package is a Gulp plugin that allows you to compile LESS files into CSS. It integrates seamlessly with Gulp's streaming build system, enabling you to automate the process of converting LESS to CSS as part of your build pipeline.

What are gulp-less's main functionalities?

Basic LESS Compilation

This feature allows you to compile LESS files into CSS. The code sample demonstrates a basic Gulp task that reads LESS files from the 'src/less' directory, compiles them into CSS, and writes the output to the 'dist/css' directory.

const gulp = require('gulp');
const less = require('gulp-less');

gulp.task('less', function () {
  return gulp.src('./src/less/**/*.less')
    .pipe(less())
    .pipe(gulp.dest('./dist/css'));
});

Source Maps

This feature allows you to generate source maps for your compiled CSS files. The code sample shows how to initialize source maps before compiling LESS files and then write the source maps to a 'maps' directory.

const gulp = require('gulp');
const less = require('gulp-less');
const sourcemaps = require('gulp-sourcemaps');

gulp.task('less', function () {
  return gulp.src('./src/less/**/*.less')
    .pipe(sourcemaps.init())
    .pipe(less())
    .pipe(sourcemaps.write('./maps'))
    .pipe(gulp.dest('./dist/css'));
});

Error Handling

This feature allows you to handle errors gracefully during the LESS compilation process. The code sample demonstrates the use of the 'gulp-plumber' package to prevent Gulp from crashing on errors.

const gulp = require('gulp');
const less = require('gulp-less');
const plumber = require('gulp-plumber');

gulp.task('less', function () {
  return gulp.src('./src/less/**/*.less')
    .pipe(plumber())
    .pipe(less())
    .pipe(gulp.dest('./dist/css'));
});

Other packages similar to gulp-less

Keywords

FAQs

Package last updated on 12 Feb 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc